<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>安全组管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/scene/sceneSecurityGroup/">安全组列表</a></li>
		<li class="active"><a href="${ctx}/scene/sceneSecurityGroup/goSecurityGroupRule?id=${sceneSecurityGroup.id}">安全组规则列表</a></li>
	</ul>
	<%--<form:form id="searchForm" modelAttribute="sceneSecurityGroupRule" action="${ctx}/scene/sceneSecurityGroupRule/" method="post" class="breadcrumb form-search">--%>
		<%--<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>--%>
		<%--<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>--%>
		<%--<ul class="ul-form">--%>
			<%--<li><label>安全组id：</label>--%>
				<%--<form:input path="id" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
			<%--</li>--%>
			<%--<li><label>远程组UUID：</label>--%>
				<%--<form:input path="remoteGroupid" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
			<%--</li>--%>
			<%--<li><label>安全组ID：</label>--%>
				<%--<form:input path="securityGroupId" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
			<%--</li>--%>
			<%--<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>--%>
			<%--<li class="clearfix"></li>--%>
		<%--</ul>--%>
	<%--</form:form>--%>
	<input id="btnSubmit" class="btn btn-primary" type="button" value="+添加规则" onclick="window.location.href='${ctx}/scene/sceneSecurityGroup/addRule?sceneSecurityGroupId=${sceneSecurityGroupId}'"/>
	<br><br>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>规则的方向</th>
				<th>IP版本</th>
				<th>IP协议</th>
				<th>远端IP前缀</th>
				<th>远端安全组</th>
				<th>端口范围</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="sceneSecurityGroupRule">
			<tr>
				<td>
					${sceneSecurityGroupRule.direction}
				</td>
				<td>
					${sceneSecurityGroupRule.ethertype}
				</td>
				<td>
					${sceneSecurityGroupRule.protocol}
				</td>
				<td>
					${sceneSecurityGroupRule.remoteIpPrefix}
				</td>
				<td>
					${sceneSecurityGroupRule.remoteGroupName}
				</td>
				<td>
					${sceneSecurityGroupRule.fromPort}<c:if test="${not empty sceneSecurityGroupRule.toPort}">-${sceneSecurityGroupRule.toPort}</c:if>
				</td>
				<td>
					<a href="${ctx}/scene/sceneSecurityGroup/deleteRule?securityGroupRuleId=${sceneSecurityGroupRule.id}&sceneSecurityGroupId=${sceneSecurityGroupId}" onclick="return confirmx('确认要删除该安全组规则吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>